using System;

namespace SealedClassExample // 命名空间
{
    // 定义一个密闭类
    public sealed class Circle
    {
        public double Radius { get; set; }

        public Circle(double radius)
        {
            Radius = radius;
        }

        public double Area()
        {
            return Math.PI * Radius * Radius;
        }

        public void Display()
        {
            Console.WriteLine($"Circle with Radius: {Radius} and Area: {Area()}");
        }
    }

    // 不能从密闭类 Circle 继承
    // public class ExtendedCircle : Circle // 这将导致编译错误

    public class Program
    {
        public static void Main(string[] args)
        {
            Circle myCircle = new Circle(5);
            myCircle.Display(); // 输出: Circle with Radius: 5 and Area: 78.53981633974483
        }
    }
}
